package com.panshi.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

/**
 * @author :jiege
 * @description :
 * @create :2020-07-30 16:02:00
 */
/*swagger 配置类*/
/*@Configuration //配置类
@EnableSwagger2 //启动swagger
public class SwaggerConfig {

    @Value("${swagger.enabled}")
    private Boolean enabled;
    @Bean
    public Docket getDocket(Environment environment) {
        return new Docket(DocumentationType.SWAGGER_2).enable(enabled).apiInfo(apiInfo()).groupName("user")
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.panshi.controller"))//一般使用这个
                .build();
    }
    //配置swagger信息=ApiInfo
    private ApiInfo apiInfo(){
        //作者信息
        return new ApiInfoBuilder()
                .title("欢迎来到swagger")
                .description("用户登入接口")
                .termsOfServiceUrl("http://127.0.0.1:8888/")
                .contact("磐石教育IT")
                .version("version 1.0")
                .build();
    }

}*/
